<template>
  <div id="recommed">
    <div class="rec-box">
      <div class="title2">
        <h2 class="h-title fl">{{title}}</h2>
      </div>
      <div class="item-list">
        <div class="box-item">
          <div class="box fl" v-for="value in recommeds" :key="value.id" @click="$router.push({name:'Detail',query:{id:value.id}})">
            <div class="pic">
              <div class="img-box">
                <img :src="value.imgs.split(',')[0]" alt>
              </div>
              <p class="pro-desc">{{value.information}}</p>
            </div>
            <div class="presente">
              <div class="on-sale">
                <span>原价{{parseInt(value.shopPrice) +200}}</span>
                <span>直降200</span>
              </div>
              <p class="item-name">{{value.productName}}</p>
              <div class="price">
                <span>￥</span>
                <span class="num">{{value.shopPrice}}</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "recommend",
  props:['recommeds'],
  data() {
    return {
      title: "专属推荐",
    };
  }
};
</script>

<style scoped>
#recommed {
  width: 100%;
  min-height: 40%;
  margin-bottom: 5%;
  /* background-color: blue; */
}
#recommed .rec-box {
  width: 1080px;
  margin: 0 auto;
  /* background-color: bisque; */
}
/* 标题 */
#recommed .rec-box .title2 {
  height: 50px;
  margin-bottom: 2%;
  /* background-color: bisque; */
}
#recommed .rec-box .title2 .h-title {
  color: #333;
  font-size: 28px;
  font-weight: 400;
}
#recommed .rec-box .item-list {
  width: 100%;
}
.item-list .box-item {
  /* height: 375px; */
  min-height: 350px;
  /* background-color: burlywood; */
}

/* 单个产品盒子 */
.item-list .box-item .box {
  height: 350px;
  width: 266.25px;
  margin-right: 0.08%;
  margin-left: 0.08%;
  border: 1px solid #e7e7e7;
  /* background-color: cadetblue; */
}
.item-list .box-item .box:hover {
  margin-top: -2px;
  /* box-shadow: 0 0 30px #ccc; */
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

/* 图片 */
.item-list .box-item .box .pic {
  height: 218px;
  width: 100%;
  text-align: center;
  /* overflow: hidden; */
  /* background-color: aliceblue; */
}
.item-list .box-item .box .pic .pro-desc {
  color: #845f3f;
  font-size: 16px;
  line-height: 20px;
  height: 20px;
  margin-top: 0;
  overflow: hidden;
  white-space: nowrap;
  -o-text-overflow: ellipsis;
  text-overflow: ellipsis;
}
.item-list .box-item .box .pic .img-box {
  padding: 45px 70px 28px;
  width: 124px;
  height: 125px;
}
.item-list .box-item .box .pic .img-box img {
  width: 100%;
  height: 100%;
}

/* 详情 */
.item-list .box-item .box .presente {
  overflow: hidden;
  margin-top: 18px;
  padding: 13px 0 10px;
  text-align: center;
  /* background-color: coral; */
  background: #f8f8f8;
}

.item-list .box-item .box .presente .on-sale {
  text-align: center;
  height: 20px;
  padding-top: 2px;
  padding-bottom: 2px;
  width: 100%;
  overflow: hidden;
}
.item-list .box-item .box .presente .on-sale span {
  background-color: rgb(217, 107, 108);
  padding: 0 6px;
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  border-radius: 2px;
  vertical-align: bottom;
}
.item-list .box-item .box .presente .item-name {
  color: #333;
  margin-top: 10px;
  font-size: 18px;
  line-height: 22px;
  height: 22px;
}
.price {
  margin-top: 11px;
  height: 26px;
  line-height: 26px;
  overflow: hidden;
  color: #a92112;
}
.price span {
  font-size: 15px;
}
.price .num {
  font-size: 22px;
}
</style>
